#include <iostream>
#include <string>
using namespace std;

class AbsBook
{
public:
    virtual string GetBook() = 0;
};

class Book : public AbsBook
{
public:
    string GetBook()
    {
        return " 三毛流浪记 ";
    }
};

class Book2 : public AbsBook
{
public:
    string GetBook()
    {
        return " 喜羊羊与灰太狼 ";
    }
};

class Mother
{
public:
    void TellStroy(AbsBook * book)
    {
        cout<<book->GetBook()<<endl;
    }
};
int main()
{
    Mother * mother = new Mother;
    AbsBook * book = new Book;
    mother->TellStroy(book);    //输出三毛流浪记
    book = new Book2;
    mother->TellStroy(book);    //输出喜羊羊与灰太狼
    return 0;
}
